package org.testis.gui.mvc.controller;

import org.testis.gui.mvc.controller.testdesign.*;
import org.testis.utils.tree.MyDefaultMutableTreeNode;
import java.awt.Frame;

/**
 *
 * @author Cahit Emir Erel
 */
public class TestDesignControllerList {

    private PopupController m_popupController;
    private TestSuiteController m_testSuiteController;
    private TestPlanController m_testPlanController;
    private TestCaseGroupController m_testCaseGroupController;
    private TestCaseController m_testCaseController;
    private PreConditionCaseController m_preConditionCaseController;
    private PostConditionCaseController m_postConditionCaseController;
    private TestStepController m_testStepController;
    private DataObjectController m_dataObjectController;
    private TreeController m_treeController;
    private LoadTestSuiteController m_loadTestSuiteController;
    private RunningTestSuiteController m_runningTestSuiteController;
    private SelectController m_selectController;
    private static TestDesignControllerList m_reference;
    private Frame m_parentFrame;
    private MyDefaultMutableTreeNode m_jDesignTreeRoot;
    private LanguageHandlerController m_languageHandlerController;
    private CompareGUIController m_compareGUIController;
    private TestStepGroupController m_testStepGroupController;
    private LanguageVariablesController m_languageVariablesController;
    private ProfileKeysController m_profileKeysController;
    private ProfileSettingsController m_profileSettingsController;
    private ProfileSettingDetailsController m_profileSettingDetailsController;
    private SearchController m_searchController;
    private ProfileSettingsSelectionController m_profileSettingsSelectionController;
    private LabelSettingsController m_labelSettingsController;
    private LabelFilterController m_labelFilterController;
    private SelectSuiteController m_selectSuiteController;
    private LabelPairSettingsController m_labelPairSettingsController;

    private TestDesignControllerList() {
    }

    public static TestDesignControllerList newInstance() {
        if (m_reference == null) {
            m_reference = new TestDesignControllerList();
        }
        return m_reference;
    }

    public static TestDesignControllerList newInstance(
            TreeController treeController,
            PopupController popupController,
            Frame displayFrame) {
        if (m_reference == null) {
            m_reference = new TestDesignControllerList();
        }
        m_reference.setDisplayFrame(displayFrame);
        m_reference.setTreeController(treeController);
        m_reference.setPopupController(popupController);
        return m_reference;
    }

    public ProfileSettingDetailsController getProfileSettingDetailsController() {
        if (m_profileSettingDetailsController == null) {
            setProfileSettingDetailsController(
                    new ProfileSettingDetailsController());
        }
        return m_profileSettingDetailsController;
    }

    public void setProfileSettingDetailsController(
            ProfileSettingDetailsController val) {
        m_profileSettingDetailsController = val;
    }

    public ProfileSettingsSelectionController getProfileSettingsSelectionController() {
        if (m_profileSettingsSelectionController == null) {
            setProfileSettingsSelectionController(
                    new ProfileSettingsSelectionController());
        }
        return m_profileSettingsSelectionController;
    }

    public void setProfileSettingsSelectionController(ProfileSettingsSelectionController val) {
        m_profileSettingsSelectionController = val;
    }

    public ProfileSettingsController getProfileSettingsController() {
        if (m_profileSettingsController == null) {
            setProfileSettingsController(new ProfileSettingsController());
        }
        return m_profileSettingsController;
    }

    public void setProfileSettingsController(ProfileSettingsController val) {
        m_profileSettingsController = val;
    }

    public ProfileKeysController getProfileKeysController() {
        if (m_profileKeysController == null) {
            setProfileKeysController(new ProfileKeysController());
        }
        return m_profileKeysController;
    }

    public void setProfileKeysController(ProfileKeysController val) {
        m_profileKeysController = val;
    }

    public LanguageVariablesController getLanguageVariablesController() {
        if (m_languageVariablesController == null) {
            setLanguageVariablesController(new LanguageVariablesController());
        }
        return m_languageVariablesController;
    }

    public void setLanguageVariablesController(LanguageVariablesController val) {
        m_languageVariablesController = val;
    }

    public LanguageHandlerController getLanguageHandlerController() {
        if (m_languageHandlerController == null) {
            setLanguageHandlerController(new LanguageHandlerController());
        }
        return m_languageHandlerController;
    }

    public void setLanguageHandlerController(LanguageHandlerController val) {
        m_languageHandlerController = val;
    }

    public TreeController getTreeController() {
        return m_treeController;
    }

    public void setTreeController(TreeController treeController) {
        m_treeController = treeController;
    }

    public PopupController getPopupController() {
        return m_popupController;
    }

    public void setPopupController(PopupController popupController) {
        m_popupController = popupController;
    }

    public Frame getParentFrame() {
        return m_parentFrame;
    }

    public void setDisplayFrame(Frame aDisplayFrame) {
        m_parentFrame = aDisplayFrame;
    }

    public LoadTestSuiteController getLoadTestSuiteController() {
        if (m_loadTestSuiteController == null) {
            setLoadTestSuiteController(new LoadTestSuiteController());
        }
        return m_loadTestSuiteController;
    }

    public void setLoadTestSuiteController(
            LoadTestSuiteController aLoadTestSuiteController) {
        m_loadTestSuiteController = aLoadTestSuiteController;
    }

    public TestSuiteController getTestSuiteController() {
        if (m_testSuiteController == null) {
            setTestSuiteController(new TestSuiteController());
        }
        return m_testSuiteController;
    }

    public void setTestSuiteController(TestSuiteController testSuiteController) {
        m_testSuiteController = testSuiteController;
    }

    public TestPlanController getTestPlanController() {
        if (m_testPlanController == null) {
            setTestPlanController(new TestPlanController());
        }
        return m_testPlanController;
    }

    public void setTestPlanController(TestPlanController testPlanController) {
        m_testPlanController = testPlanController;
    }

    public TestCaseGroupController getTestCaseGroupController() {
        if (m_testCaseGroupController == null) {
            setTestCaseGroupController(new TestCaseGroupController());
        }
        return m_testCaseGroupController;
    }

    public void setTestCaseGroupController(
            TestCaseGroupController testCaseGroupController) {
        m_testCaseGroupController = testCaseGroupController;
    }

    public TestCaseController getTestCaseController() {
        if (m_testCaseController == null) {
            setTestCaseController(new TestCaseController());
        }
        return m_testCaseController;
    }

    public void setTestCaseController(TestCaseController testCaseController) {
        m_testCaseController = testCaseController;
    }

    public PreConditionCaseController getPreConditionCaseController() {
        if (m_preConditionCaseController == null) {
            setPreConditionCaseController(new PreConditionCaseController());
        }
        return m_preConditionCaseController;
    }

    public void setPreConditionCaseController(
            PreConditionCaseController preConditionCaseController) {
        m_preConditionCaseController = preConditionCaseController;
    }

    public PostConditionCaseController getPostConditionCaseController() {
        if (m_postConditionCaseController == null) {
            setPostConditionCaseController(new PostConditionCaseController());
        }
        return m_postConditionCaseController;
    }

    public void setPostConditionCaseController(
            PostConditionCaseController postConditionCaseController) {
        m_postConditionCaseController = postConditionCaseController;
    }

    public TestStepController getTestStepController() {
        if (m_testStepController == null) {
            setTestStepController(new TestStepController());
        }
        return m_testStepController;
    }

    public void setTestStepController(TestStepController testStepController) {
        m_testStepController = testStepController;
    }

    public DataObjectController getDataObjectController() {
        if (m_dataObjectController == null) {
            setDataObjectController(new DataObjectController());
        }
        return m_dataObjectController;
    }

    public void setDataObjectController(
            DataObjectController dataObjectController) {
        m_dataObjectController = dataObjectController;
    }

    public RunningTestSuiteController getRunningTestSuiteController() {
        if (m_runningTestSuiteController == null) {
            setRunningTestSuiteController(new RunningTestSuiteController());
        }
        return m_runningTestSuiteController;
    }

    public void setRunningTestSuiteController(
            RunningTestSuiteController runningTestSuiteController) {
        m_runningTestSuiteController = runningTestSuiteController;
    }

    public SelectController getSelectController() {
        if (m_selectController == null) {
            setSelectController(new SelectController());
        }
        return m_selectController;
    }

    public void setSelectController(SelectController selectController) {
        m_selectController = selectController;
    }

    public MyDefaultMutableTreeNode getJDesignTreeRoot() {
        if (m_jDesignTreeRoot == null) {
            setJDesignTreeRoot(new MyDefaultMutableTreeNode(true));
        }
        return m_jDesignTreeRoot;
    }

    public void setJDesignTreeRoot(MyDefaultMutableTreeNode jDesignTreeRoot) {
        m_jDesignTreeRoot = jDesignTreeRoot;
    }

 

    public CompareGUIController getCompareGUIController() {
        if (m_compareGUIController == null) {
            m_compareGUIController = new CompareGUIController();
        }
        return m_compareGUIController;
    }

    public void setCompareGUIController(
            CompareGUIController m_compareGUIController) {
        this.m_compareGUIController = m_compareGUIController;
    }

    public TestStepGroupController getTestStepGroupController() {
        if (m_testStepGroupController == null) {
            m_testStepGroupController = new TestStepGroupController();
        }
        return m_testStepGroupController;
    }

    public void setTestStepGroupController(
            TestStepGroupController testStepGroupController) {
        m_testStepGroupController = testStepGroupController;
    }

    public SearchController getSearchController() {
        if (m_searchController == null) {
            m_searchController = new SearchController();
        }
        return m_searchController;
    }

    public void setSearchController(SearchController searchController) {
        m_searchController = searchController;
    }

    /**
     * @return the m_labelSettingsController
     */
    public LabelSettingsController getLabelSettingsController() {
        if (m_labelSettingsController == null) {
            m_labelSettingsController = new LabelSettingsController();
        }
        return m_labelSettingsController;
    }

    /**
     * @param m_labelSettingsController the m_labelSettingsController to set
     */
    public void setLabelSettingsController(LabelSettingsController controller) {
        this.m_labelSettingsController = controller;
    }

    public LabelFilterController getLabelFilterController() {
        if (m_labelFilterController == null) {
            m_labelFilterController = new LabelFilterController();
        }
        return m_labelFilterController;
    }

    public void setLabelFilterController(LabelFilterController controller) {
        this.m_labelFilterController = controller;
    }

    public SelectSuiteController getSelectSuiteController() {
        if (m_selectSuiteController == null) {
            m_selectSuiteController = new SelectSuiteController();
        }
        return m_selectSuiteController;
    }

    public void setSelectSuiteController(SelectSuiteController controller) {
        this.m_selectSuiteController = controller;
    }

    public LabelPairSettingsController getLabelPairSettingsController() {
       if (m_labelPairSettingsController == null) {
            setLabelPairSettingsController(new LabelPairSettingsController());
        }
        return m_labelPairSettingsController;
    }

    public void setLabelPairSettingsController(LabelPairSettingsController controller) {
        this.m_labelPairSettingsController = controller;
    }
}
